package com.rulestech.salespro.inventory;


public class TraditionalDiscount extends Discount {

	public enum Selection{
		MAXIMUM,MINIMUM,AVERAGE;
	}
	
	/**
	 * The list contains the desired discount parameters to be used when deciding the discount
	 */
	private Selection selection;
	
	public TraditionalDiscount(long productId, Selection selection, boolean useDefaultSetting){
		super(productId, Discount.Type.TRADITIONAL, useDefaultSetting);
		this.selection = selection;
	}
	
	
	public Selection getSelection(){
		return selection;
	}
	
	/**
	 * Set the rate of the discount based on the selection of the Traditional Discount type.
	 */
	public void setRate (double rate){
		switch (selection){
		case MAXIMUM:
			if (rate > getRate()){
				setRate(rate);
			}
		case MINIMUM:
			if (rate <getRate()){
				setRate(rate);
			}
		case AVERAGE:
			
		}
	}
}
